package com.iflytek.uoamp.agent.monitor.sender.biz;

import java.util.List;

import com.iflytek.uoamp.agent.core.sender.monitorsender.monitorinterface.IItem;
import com.iflytek.uoamp.agent.monitor.sender.config.Config;
import com.iflytek.uoamp.agent.monitor.sender.interfaces.ISenderFactory;
import com.iflytek.uoamp.agent.monitor.sender.loadbalance.LoadbalanceManager;

public abstract class AbsSender {

	@SuppressWarnings("rawtypes")
	private ISenderFactory factory;
	
	protected final Config config;
	protected LoadbalanceManager lbManager;
	
	public LoadbalanceManager getLbManager() {
		return lbManager;
	}

	public void setLbManager(LoadbalanceManager lbManager) {
		this.lbManager = lbManager;
	}

	public AbsSender(Config config) {
		this.config = config;
	}
	
	@SuppressWarnings("rawtypes")
	public AbsSender(LoadbalanceManager lbManager,ISenderFactory factory, Config config) {
		this.config = config;
		this.factory = factory;
		this.lbManager = lbManager;
	}

	@SuppressWarnings("rawtypes")
	public ISenderFactory getFactory() {
		return factory;
	}

	@SuppressWarnings("rawtypes")
	public void setFactory(ISenderFactory factory) {
		this.factory = factory;
	}

	public Config getConfig() {
		return config;
	}

	public boolean isTransfer() {
		return true;
	}

	public abstract Object send(IItem item);

	public abstract Object sendBatch(List<IItem> item);

}
